3.2.8 \(\int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx\) [108]

3.2.8.1 Optimal result
3.2.8.2 Mathematica [A] (verified)
3.2.8.3 Rubi [A] (verified)
3.2.8.4 Maple [C] (warning: unable to verify)
3.2.8.5 Fricas [F]
3.2.8.6 Sympy [F(-1)]
3.2.8.7 Maxima [F]
3.2.8.8 Giac [F]
3.2.8.9 Mupad [F(-1)]

3.2.8.1 Optimal result

Integrand size = 25, antiderivative size = 221 \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=-\frac {i b^2}{2 d^2 (i-c x)}+\frac {i b^2 \arctan (c x)}{2 d^2}+\frac {b (a+b \arctan (c x))}{d^2 (i-c x)}-\frac {(a+b \arctan (c x))^2}{2 d^2}+\frac {i (a+b \arctan (c x))^2}{d^2 (i-c x)}+\frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d^2}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2}{1+i c x}\right )}{d^2}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d^2}+\frac {b^2 \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d^2} \]

output
-1/2*I*b^2/d^2/(I-c*x)+1/2*I*b^2*arctan(c*x)/d^2+b*(a+b*arctan(c*x))/d^2/( 
I-c*x)-1/2*(a+b*arctan(c*x))^2/d^2+I*(a+b*arctan(c*x))^2/d^2/(I-c*x)-2*(a+ 
b*arctan(c*x))^2*arctanh(-1+2/(1+I*c*x))/d^2+(a+b*arctan(c*x))^2*ln(2/(1+I 
*c*x))/d^2+I*b*(a+b*arctan(c*x))*polylog(2,-1+2/(1+I*c*x))/d^2+1/2*b^2*pol 
ylog(3,-1+2/(1+I*c*x))/d^2
 
3.2.8.2 Mathematica [A] (verified)

Time = 0.81 (sec) , antiderivative size = 299, normalized size of antiderivative = 1.35 \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\frac {-\frac {24 i a^2}{-i+c x}-24 i a^2 \arctan (c x)+24 a^2 \log (c x)-12 a^2 \log \left (1+c^2 x^2\right )-12 a b \left (4 i \arctan (c x)^2+i \cos (2 \arctan (c x))+2 i \operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )-2 \arctan (c x) \left (\cos (2 \arctan (c x))+2 \log \left (1-e^{2 i \arctan (c x)}\right )-i \sin (2 \arctan (c x))\right )+\sin (2 \arctan (c x))\right )+b^2 \left (-i \pi ^3-6 \cos (2 \arctan (c x))-12 i \arctan (c x) \cos (2 \arctan (c x))+12 \arctan (c x)^2 \cos (2 \arctan (c x))+24 \arctan (c x)^2 \log \left (1-e^{-2 i \arctan (c x)}\right )+24 i \arctan (c x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (c x)}\right )+12 \operatorname {PolyLog}\left (3,e^{-2 i \arctan (c x)}\right )+6 i \sin (2 \arctan (c x))-12 \arctan (c x) \sin (2 \arctan (c x))-12 i \arctan (c x)^2 \sin (2 \arctan (c x))\right )}{24 d^2} \]

input
Integrate[(a + b*ArcTan[c*x])^2/(x*(d + I*c*d*x)^2),x]
 
output
(((-24*I)*a^2)/(-I + c*x) - (24*I)*a^2*ArcTan[c*x] + 24*a^2*Log[c*x] - 12* 
a^2*Log[1 + c^2*x^2] - 12*a*b*((4*I)*ArcTan[c*x]^2 + I*Cos[2*ArcTan[c*x]] 
+ (2*I)*PolyLog[2, E^((2*I)*ArcTan[c*x])] - 2*ArcTan[c*x]*(Cos[2*ArcTan[c* 
x]] + 2*Log[1 - E^((2*I)*ArcTan[c*x])] - I*Sin[2*ArcTan[c*x]]) + Sin[2*Arc 
Tan[c*x]]) + b^2*((-I)*Pi^3 - 6*Cos[2*ArcTan[c*x]] - (12*I)*ArcTan[c*x]*Co 
s[2*ArcTan[c*x]] + 12*ArcTan[c*x]^2*Cos[2*ArcTan[c*x]] + 24*ArcTan[c*x]^2* 
Log[1 - E^((-2*I)*ArcTan[c*x])] + (24*I)*ArcTan[c*x]*PolyLog[2, E^((-2*I)* 
ArcTan[c*x])] + 12*PolyLog[3, E^((-2*I)*ArcTan[c*x])] + (6*I)*Sin[2*ArcTan 
[c*x]] - 12*ArcTan[c*x]*Sin[2*ArcTan[c*x]] - (12*I)*ArcTan[c*x]^2*Sin[2*Ar 
cTan[c*x]]))/(24*d^2)
 
3.2.8.3 Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {5411, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx\)

\(\Big \downarrow \) 5411

\(\displaystyle \int \left (\frac {(a+b \arctan (c x))^2}{d^2 x}-\frac {c (a+b \arctan (c x))^2}{d^2 (c x-i)}+\frac {i c (a+b \arctan (c x))^2}{d^2 (c x-i)^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d^2}+\frac {i b \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{d^2}+\frac {b (a+b \arctan (c x))}{d^2 (-c x+i)}+\frac {i (a+b \arctan (c x))^2}{d^2 (-c x+i)}-\frac {(a+b \arctan (c x))^2}{2 d^2}+\frac {\log \left (\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d^2}+\frac {i b^2 \arctan (c x)}{2 d^2}+\frac {b^2 \operatorname {PolyLog}\left (3,\frac {2}{i c x+1}-1\right )}{2 d^2}-\frac {i b^2}{2 d^2 (-c x+i)}\)

input
Int[(a + b*ArcTan[c*x])^2/(x*(d + I*c*d*x)^2),x]
 
output
((-1/2*I)*b^2)/(d^2*(I - c*x)) + ((I/2)*b^2*ArcTan[c*x])/d^2 + (b*(a + b*A 
rcTan[c*x]))/(d^2*(I - c*x)) - (a + b*ArcTan[c*x])^2/(2*d^2) + (I*(a + b*A 
rcTan[c*x])^2)/(d^2*(I - c*x)) + (2*(a + b*ArcTan[c*x])^2*ArcTanh[1 - 2/(1 
 + I*c*x)])/d^2 + ((a + b*ArcTan[c*x])^2*Log[2/(1 + I*c*x)])/d^2 + (I*b*(a 
 + b*ArcTan[c*x])*PolyLog[2, -1 + 2/(1 + I*c*x)])/d^2 + (b^2*PolyLog[3, -1 
 + 2/(1 + I*c*x)])/(2*d^2)
 

3.2.8.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5411
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_ 
.)*(x_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*ArcTan[c*x])^p, (f* 
x)^m*(d + e*x)^q, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[p, 0] & 
& IntegerQ[q] && (GtQ[q, 0] || NeQ[a, 0] || IntegerQ[m])
 
3.2.8.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 6.57 (sec) , antiderivative size = 1670, normalized size of antiderivative = 7.56

method result size
parts \(\text {Expression too large to display}\) \(1670\)
derivativedivides \(\text {Expression too large to display}\) \(1671\)
default \(\text {Expression too large to display}\) \(1671\)

input
int((a+b*arctan(c*x))^2/x/(d+I*c*d*x)^2,x,method=_RETURNVERBOSE)
 
output
a^2/d^2*ln(x)+I*a^2/d^2/(-c*x+I)-1/2*a^2/d^2*ln(c^2*x^2+1)-I*a^2/d^2*arcta 
n(c*x)+b^2/d^2*(2*polylog(3,(1+I*c*x)/(c^2*x^2+1)^(1/2))+2*polylog(3,-(1+I 
*c*x)/(c^2*x^2+1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+1)-1)/(1+(1+I*c*x)^2/(c^ 
2*x^2+1)))^3*arctan(c*x)^2-1/2*I*Pi*csgn(I*((1+I*c*x)^2/(c^2*x^2+1)-1)/(1+ 
(1+I*c*x)^2/(c^2*x^2+1)))*csgn(((1+I*c*x)^2/(c^2*x^2+1)-1)/(1+(1+I*c*x)^2/ 
(c^2*x^2+1)))^2*arctan(c*x)^2+arctan(c*x)^2*ln(2*I*(1+I*c*x)^2/(c^2*x^2...
 
3.2.8.5 Fricas [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x)^2,x, algorithm="fricas")
 
output
1/4*(I*b^2*log(-(c*x + I)/(c*x - I))^2 - (b^2*c*x - I*b^2)*log(2*c*x/(c*x 
- I))*log(-(c*x + I)/(c*x - I))^2 - 2*(b^2*c*x - I*b^2)*dilog(-2*c*x/(c*x 
- I) + 1)*log(-(c*x + I)/(c*x - I)) + 4*(c*d^2*x - I*d^2)*integral(-(a^2*c 
*x + I*a^2 - ((-I*a*b - b^2)*c*x + a*b)*log(-(c*x + I)/(c*x - I)))/(c^3*d^ 
2*x^4 - I*c^2*d^2*x^3 + c*d^2*x^2 - I*d^2*x), x) + 2*(b^2*c*x - I*b^2)*pol 
ylog(3, -(c*x + I)/(c*x - I)))/(c*d^2*x - I*d^2)
 
3.2.8.6 Sympy [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\text {Timed out} \]

input
integrate((a+b*atan(c*x))**2/x/(d+I*c*d*x)**2,x)
 
output
Timed out
 
3.2.8.7 Maxima [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x)^2,x, algorithm="maxima")
 
output
a^2*(-I/(c*d^2*x - I*d^2) - log(c*x - I)/d^2 + log(x)/d^2) - 1/32*(8*I*b^2 
*arctan(c*x)^2 - 8*(-I*b^2*c*x - b^2)*arctan(c*x)^3 - (b^2*c*x - I*b^2)*lo 
g(c^2*x^2 + 1)^3 - 2*(I*b^2 + (-I*b^2*c*x - b^2)*arctan(c*x))*log(c^2*x^2 
+ 1)^2 - (6*b^2*c^4*(c^2/(c^8*d^2*x^2 + c^6*d^2) + log(c^2*x^2 + 1)/(c^6*d 
^2*x^2 + c^4*d^2)) - 256*b^2*c^4*integrate(1/16*x^4*arctan(c*x)^2/(c^4*d^2 
*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) - 64*b^2*c^4*integrate(1/16*x^4*log(c^2* 
x^2 + 1)^2/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) - 256*b^2*c^3*integra 
te(1/16*x^3*arctan(c*x)/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) - 16*(c* 
(x/(c^4*d^2*x^2 + c^2*d^2) + arctan(c*x)/(c^3*d^2)) - 2*arctan(c*x)/(c^4*d 
^2*x^2 + c^2*d^2))*a*b*c^2 - 640*b^2*c^2*integrate(1/16*x^2*arctan(c*x)^2/ 
(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) + 3*b^2*c^2*log(c^2*x^2 + 1)^2/( 
c^4*d^2*x^2 + c^2*d^2) - 256*b^2*c*integrate(1/16*x*arctan(c*x)*log(c^2*x^ 
2 + 1)/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) - 256*b^2*c*integrate(1/1 
6*x*arctan(c*x)/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) + 384*b^2*integr 
ate(1/16*arctan(c*x)^2/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) + 32*b^2* 
integrate(1/16*log(c^2*x^2 + 1)^2/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x 
) + 1024*a*b*integrate(1/16*arctan(c*x)/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2 
*x), x))*(c*d^2*x - I*d^2) - 32*(I*c*d^2*x + d^2)*integrate(1/8*(b^2*c^3*x 
^3*log(c^2*x^2 + 1)^2 - 32*a*b*c*x*arctan(c*x) + 4*(b^2*c^3*x^3 - 2*b^2*c* 
x)*arctan(c*x)^2 - 2*(b^2*c^3*x^3 + b^2*c*x - (b^2*c^2*x^2 - b^2)*arcta...
 
3.2.8.8 Giac [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x)^2,x, algorithm="giac")
 
output
sage0*x
 
3.2.8.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)^2} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{x\,{\left (d+c\,d\,x\,1{}\mathrm {i}\right )}^2} \,d x \]

input
int((a + b*atan(c*x))^2/(x*(d + c*d*x*1i)^2),x)
 
output
int((a + b*atan(c*x))^2/(x*(d + c*d*x*1i)^2), x)